<!DOCTYPE html>

<html lang="en">

<head>

	<meta charset="UTF-8">

	<title>我的会员</title>

	<meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no"
		name="viewport">

	<script src="js/flexible.js"></script>

	<link rel="stylesheet" href="css/reset.css">

	<link rel="stylesheet" href="css/homePage.css">

	<link rel="stylesheet" href="css/flexible.css">

	<link rel="stylesheet" href="css/vant.css">

	<script src="js/jquery-3.3.1.min.js"></script>

	<script src="js/vue/vue.js"></script>

	<script src="js/vue/axios.js"></script>

	<script src="js/vue/MD5.js"></script>

	<script src="js/vue/vant.js"></script>

</head>

<body>

	<div id="app">

		<div class="container_box" style="padding-bottom: .8rem">

			<header>

				<div class="search bar3 lf">

					<form @submit.prevent action="#">

						<input style="width: 100%;" @keyup.enter.native="search" v-model="key" type="search"
							placeholder="搜索会员姓名/手机号码">

						<button @click="search" type="text"><img src="images/search.png"></button>

					</form>

				</div>

				<div class="rf logo_info">

					<img src="images/logo.png" class="quit" @click="showSets">

					<div class="logo" v-show="showSet">

						<p><a href="editPass.html">修改密码</a></p>
						<p><a @click="loginout">退出登录</a></p>
						<!-- <p><a href="login.html">退出登录</a></p> -->

					</div>

				</div>

			</header>

			<template>

				<div class="group_details group_details_state clearfix" v-for="item in list" @click="details(item.Uid)">

					<div class="fl head_card">

						<img :src="item.Picurl" onerror="this.src='images/moren.png'" alt="" class="spinning_img">

					</div>

					<div class="spinning_txt fl content_right">

						<p class="margin_bottom">

							<span class="fontsize12">{{item.Username}}</span>

							<span class="spinning_txx">

								<img v-if="item.Sex=='1'" src="images/man.png">

								<img v-else src="images/woman.png">

							</span>

						</p>

						<p style="margin-bottom: 0.1rem;">

							<span class="spinning_name"><a :href="'tel:' + item.Phone">{{item.Phone}}</a></span>

							<span class="font_size12 rf">

								<span class="fontsize12">跟进日期</span>

								<span class="fontsize12">{{item.Followtime}}</span>

							</span>

						</p>

					</div>

				</div>

				<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getData">

					<van-cell v-for="item in lists" :key="item" :title="item" />

				</van-list>

			</template>

		</div>

		<div class="footer_bar">

			<ul class="clearfix">

				<li>

					<a :href="'index.html?vid='+vid+''" class="first_a">

						<p style="color: #333346;">首页</p>

					</a>

				</li>

				<li>

					<a href="league.html" class="second_a">

						<p>代约团课</p>

					</a>

				</li>

				<li>

					<a href="privateLessons.html" class="thrid_a">

						<p>代约私教</p>

					</a>

				</li>

				<li>

					<a href="myMember.html" class="four_a foot_active">

						<p>我的会员</p>

					</a>

				</li>

			</ul>

		</div>

	</div>

</body>

<script>

	new Vue({

		el: '#app',

		data: {

			vid: '',

			lists: [],

			loading: false,

			finished: false,

			showSet: false,

			list: [],

			page: 1,

			moren: 'images/moren.png',

			page: '',

			totalnum: '',

			totalpage: '',

			listd: [],

			key: ''

		},

		created() {

			//this.onLoad()

		},

		methods: {

			//设置参数

			setCanS() {

				let Request = new Object()

				Request = GetRequest()

				// this.from.type = Request['type']

				// this.from.state = parseInt(Request['state'])

			},
			getData() {
				console.log(this.page);
				if (!this.page) {
					this.page = 1;
				}
				// 异步更新数据

				this.vid = sessionStorage.getItem('vids')

				const params = {

					page: this.page,

					key: this.key

				}

				getVs()

				axios.get('/mobileapi/coach/user.php?act=list', { params: params }).then(data => {

					console.log(data.data)

					let { msg, code, user } = data.data

					if (code !== 200) {

						_this.$message({

							message: msg,

							type: 'error'

						});

					} else {

						data = data.data

						this.listd = data.data.list

						this.totalnum = data.data.totalnum

						this.page += 1;

						for (let i in this.listd) {

							if (this.listd[i].Picurl == "" || this.listd[i].Picurl == null) {

								//alert("2")

								this.listd[i].Picurl = 'images/moren.png'

							}

						}

						for (let i = 0; i < this.listd.length; i++) {

							this.list.push(this.listd[i])

						}

						// 加载状态结束

						this.loading = false

						// 数据全部加载完成

						if (this.list.length >= this.totalnum) {

							this.finished = true

						}

					}

				}).catch(function (error) {

					console.log(error);

				})
			},

			onLoad() {
				console.log("onLoad");

				setTimeout(() => {



					console.log(this.listd)



				}, 500);

			},

			//详情

			details(id) {

				window.location.href = 'memberDetails.html?uid=' + id + ''

			},

			search() {
				this.page = 1

				this.lists = []

				this.list = []

				this.getData()

			},

			showSets() {

				this.showSet = !this.showSet

			},
			loginout() {
				sessionStorage.clear();
				localStorage.clear();
				window.location.href = 'login.html'

			}

		}

	})

</script>

</html>